"""
How to update a row in a table? Can I use tbl.readWhere()?
Can I use tbl.where()?
"""
    
import tables as t

DB = t.openFile("eheh.h5", "w")
tbl = DB.createTable("/", "aaba",
    {"id": t.IntCol(pos=0), "name": t.StringCol(1000000, pos=1)})
rows = [(1, "Aimeidei"), (2, "Duceu"), (3, "Tintolassi")]
tbl.append(rows)
tbl.flush()


for row in tbl.where("name == 'Duceu'"):
    row["name"] = "Juvencio"
    row.update()
    print "Como assim"

w = tbl.where("id == 4")
print len(w)
row = w.next()
row["name"] = "Gumercindo"
row.update()

tbl.flush()
DB.close()
